#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_checkBox_clicked()
{
    QString s("请选择您需要的饮料：");
    if(ui->checkBox->isChecked())
        s+=ui->checkBox->text()+" ";
    if(ui->checkBox_2->isChecked())
        s+=ui->checkBox_2->text()+" ";
    if(ui->checkBox_3->isChecked())
        s+=ui->checkBox_3->text()+" ";
    ui->label->setText(s);
}

void Widget::on_checkBox_2_clicked()
{
    QString s("请选择您需要的饮料：");
    if(ui->checkBox->isChecked())
        s+=ui->checkBox->text()+" ";
    if(ui->checkBox_2->isChecked())
        s+=ui->checkBox_2->text()+" ";
    if(ui->checkBox_3->isChecked())
        s+=ui->checkBox_3->text()+" ";
    ui->label->setText(s);
}

void Widget::on_checkBox_3_clicked()
{
    QString s("请选择您需要的饮料：");
    if(ui->checkBox->isChecked())
        s+=ui->checkBox->text()+" ";
    if(ui->checkBox_2->isChecked())
        s+=ui->checkBox_2->text()+" ";
    if(ui->checkBox_3->isChecked())
        s+=ui->checkBox_3->text()+" ";
    ui->label->setText(s);
}
